import java.util.ArrayList;
import java.util.Scanner;

/**
 * Created by hansheng11 on 2019/12/4 19:48.
 */
public class 第9题_回文数 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (sc.hasNext()) {
            int x = sc.nextInt();
            System.out.println(isPalindrome(x));
        }
    }

    public static boolean isPalindrome(int x) {
        if (x < 0) {
            return false;
        }
        if (x / 10 == 0) {
            return true;
        }
        if (x % 10 == 0) {
            return false;
        }
        int y = 0;
        while (true) {
            y = y*10 + x % 10;
            if (y >= x) {
                break;
            }
            x /= 10;
            if (y >= x) {
                break;
            }
        }
        if (x == y) {
            return true;
        }
        return false;
    }
}
